﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace SachOnlineLibrary.Public
{
    public class ChiTietHoaDon
    {
        public int maSach { get; set; }
        public int maPhieu { get; set; }
        public int soLuong { get; set; }
        public float donGia { get; set; }
        public Sach sach { get; set; }

        public ChiTietHoaDon()
        {

        }

        public void ChuyenDoi(DataRow dr)
        {
            if (dr[0] != null && string.IsNullOrEmpty(dr[0].ToString()) == false)
            {
                maSach = int.Parse(dr[0].ToString());
            }

            if (dr[1] != null && string.IsNullOrEmpty(dr[1].ToString()) == false)
            {
                maPhieu = int.Parse(dr[1].ToString());
            }
 
            //if (dr[2] != null && string.IsNullOrEmpty(dr[2].ToString()) == false)
            //{
            //    soLuong = int.Parse(dr[2].ToString());
            //}

            //if (dr[3] != null && string.IsNullOrEmpty(dr[3].ToString()) == false)
            //{
            //    donGia = float.Parse(dr[3].ToString());
            //}
        }
    }
}
